import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:laos_mall/common/style/extension_util.dart';
import 'package:laos_mall/common/widght/appbar_widget.dart';
import 'package:qr_flutter/qr_flutter.dart';

import '../../../common/style/app_style.dart';
import '../../../common/widght/item_widget.dart';
import 'logic.dart';

class PointQRCodePage extends StatelessWidget {
  PointQRCodePage({Key? key}) : super(key: key);

  final logic = Get.put(PointQRCodeLogic());

  @override
  Widget build(BuildContext context) {

    return Obx(() {
      return Scaffold(
        appBar: AppBarWidget(text: "point_qr_code".tr,),
        body: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: [
            QrImageView(data: "123123", size: 200),
            SizedBox(height: 12.h,),
            ItemWidget(
              prefixItem: Text(
                "REFRESH IN ",
                style: AppStyle.subtitleLightStyle,
              ),
              suffixItem: Text(
                "${logic.timerController.seconds}S",
                style: AppStyle.subtitleStyle,
              ),
              mainAxisAlignment: MainAxisAlignment.center,
            ),
            SizedBox(height: 60.h,),
            Text(
              """This QR code contains your account information, please keep it secure. Do not share your QR code with others. If misuse is detected, we reserve the right to deactivate your account.""",
              style: AppStyle.subtitleLightStyleGray,
              textAlign: TextAlign.center,
            ).addPadding(EdgeInsets.symmetric(horizontal: 47.w)),
          ],
        ),
      );
    });
  }
}
